<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增评论信息管理')" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-comment-add">
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">帖子id：</label>
                <div class="col-sm-8">
                    <input name="postsId" class="form-control" th:value="${comment.postsId}" type="text" readonly>
                </div>
            </div>

            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">父评论的用户id：</label>
                <div class="col-sm-8">
                    <input name="parentUserId" th:value="${comment.userId}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">父评论id：</label>
                <div class="col-sm-8">
                    <input name="parentCommentId" th:value="${comment.commentId}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">评论内容：</label>
                <div class="col-sm-8">
                    <script id="editor" name="content" type="text/plain" style="height: 300px;"></script>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: ueditor-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/comment"
        $("#form-comment-add").validate({
            focusCleanup: true
        });

        function submitHandler() {

                $.operate.saveComment(prefix + "/addReply", $('#form-comment-add').serialize());
                alert("评论成功")
                window.location.reload();
                window.close()
        }

        var ue = UE.getEditor('editor', {
            toolbars: [
                ['emotion']
            ], autoHeightEnabled: true, initialFrameHeight: 50
        });

        function getContentTxt() {
            return UE.getEditor('editor').getContentTxt();
        }
    </script>
</body>
</html>